import { DataRPermits } from './dataRPermits';

export interface DataRegister {
    version?: number;
    updateTime?: number;
    id?: string;
    objectId?: string;
    objectType?: string;
    dataType?: DataRegisterDataType;
    data?: any;
    userIds?: string[];
    datarPermits?: DataRPermits[];
    parentDataRegisterId?: string;
    status?: string;
}

export interface WorkflowOrder {
    id?: string;
    status?: WorkflowOrderStatus;
    workflowId?: string;
    createTime?: number;
    updateTime?: number;
    finishTime?: number;
    fields?: any;
    flowNodesItems?: WorkflowOrderNodesItem[];
}

export interface WorkflowOrderNodesItem {
    updateTime?: number;
    id?: string;
    flowNodeId?: string;
    workflowOrderId?: string;
    beginTime?: number;
    endTime?: number;
    status?: WorkflowOrderNodesItemStatus;
    nodeName?: string;
    disabled?: boolean;
    /**
     * 执行人
     *
     */
    executor?: {
        userId: string;
        name: string;
    };
}


export declare type DataRegisterDataType = 'workflowOrder' | string;

export declare type WorkflowOrderStatus = 'init' | 'doing' | 'closed';

export declare type WorkflowOrderNodesItemStatus = 'wait' | 'process' | 'unclosed' | 'finish' | 'error';
